package com.nativetalk.common;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

/**
 * @author lizhun
 * @version V1.0
 * @ClassName: Common.java
 */
@Component
public class Constants {
    private static Logger logger = Logger.getLogger(Constants.class);

    //    ********************* 1 推送配置 start **********************************************
    //个推学生端
    public static String student_appId = "gc0KEPA5a69S5k3MdcgcE";

    @Value("${getui.student_appId}")
    public void setStudent_appId(String value) {
        logger.info("getui.student_appId=" + value);
        student_appId = value;
    }

    public static String student_appKey = "ulTBJiMsEs69vCnP2YUl4";

    @Value("${getui.student_appKey}")
    public void setStudent_appKey(String value) {
        logger.info("getui.student_appKey=" + value);
        student_appKey = value;
    }

    public static String student_masterSecret = "3U52SIrMMu627UhIgo7WR5";

    @Value("${getui.student_masterSecret}")
    public void setStudent_masterSecret(String value) {
        logger.info("getui.student_masterSecret=" + value);
        student_masterSecret = value;
    }

    //个推教师端
    public static String teacher_appId = "LZPYOoKC5k5l3szyvlWaI4";

    @Value("${getui.teacher_appId}")
    public void setTeacher_appId(String value) {
        logger.info("getui.teacher_appId=" + value);
        teacher_appId = value;
    }

    public static String teacher_appKey = "7fhcMUjVah9jS1ni2XN7c8";

    @Value("${getui.teacher_appKey}")
    public void setTeacher_appKey(String value) {
        logger.info("getui.teacher_appKey=" + value);
        teacher_appKey = value;
    }

    public static String teacher_masterSecret = "rO2zzcX4Lq9E38BYX3tM54";

    @Value("${getui.teacher_masterSecret}")
    public void setTeacher_masterSecret(String value) {
        logger.info("getui.teacher_masterSecret=" + value);
        teacher_masterSecret = value;
    }

    //********************* 推送配置 end *****************************************************************

    //********************* 2 分享URL配置 start **********************************************************
    //测试环境 分享URL配置信息 -----------------------------------------------------------------------------------
//    public static String share_live_url = "http://192.168.106.102:8080/nativetalk/live/share?live_his_id=";       //直播分享URL
//    public static String share_teacher_url = "http://192.168.106.102:8080/nativetalk/teacher/share?user_id=";     //老师信息分享URL
//    public static String teacher_ranking_url = "http://192.168.106.102:8080/nativetalk/teacher/ranking?user_id="; //老师排名URL
//    public static String member_clockin_url = "http://192.168.106.102:8080/nativetalk/member/clockin?id=";        //用户打卡URL
//    public static String member_ranking_url = "http://192.168.106.102:8080/nativetalk/member/ranking?user_id=";   //用户排名URL

    //预发布环境 分享URL配置信息---------------------------------------------------------------------------
//	public static String share_live_url = "http://47.96.38.25:8080/nativetalk/live/share?live_his_id=";         //直播分享URL
//	public static String share_teacher_url = "http://47.96.38.25:8080/nativetalk/teacher/share?user_id=";       //老师信息分享URL
//	public static String teacher_ranking_url = "http://47.96.38.25:8080/nativetalk/teacher/ranking?user_id=";   //老师排名URL
//	public static String member_ranking_url = "http://47.96.38.25:8080/nativetalk/member/ranking?user_id=";     //用户打卡URL
//	public static String member_clockin_url = "http://47.96.38.25:8080/nativetalk/member/clockin?id=";          //用户排名URL

//  //生产环境 分享URL配置信息---------------------------------------------------------------------------
	public static String share_live_url = "http://share.waijiaojun.com:8080/nativetalk/live/share?live_his_id=";         //直播分享URL
	public static String share_teacher_url = "http://share.waijiaojun.com:8080/nativetalk/teacher/share?user_id=";       //老师信息分享URL
	public static String teacher_ranking_url = "http://share.waijiaojun.com:8080/nativetalk/teacher/ranking?user_id=";   //老师排名URL
	public static String member_ranking_url = "http://share.waijiaojun.com:8080/nativetalk/member/ranking?user_id=";     //用户打卡URL
	public static String member_clockin_url = "http://share.waijiaojun.com:8080/nativetalk/member/clockin?id=";          //用户排名URL
////********************* 2 分享URL配置 end **********************************************************


    public final static String teacher = "testteacher";
    public final static String member = "testmember";

    /**
     * 设备id,手机等终端设备的唯一标识，推送消息时使用设备id。
     * 如果手机端在注册或登录时，没有带过来equ_client_id那么使用默认的设备id,
     * 警告：这时客户端将无法接收到推送的消息，当然也无法接听呼叫功能。
     */
    public static final String default_equ_id = "1212313fasdf";

    /**
     * 客户端手机类型 1 android
     */
    public static final String equ_type_android = "1";

    /**
     * 客户端手机类型 2 ios
     */
    public static final String equ_type_ios = "2";

    /**
     * 用户类型 1学生
     */
    public static final String user_type_student = "1";
    /**
     * 用户类型 2老师
     */
    public static final String user_type_teacher = "2";

    //使用https的域名
    public static String url = "https://api.getui.com/apiex.htm";
    public final static String getui_url = "http://sdk.open.api.igexin.com/serviceex";
    /**
     * ping++ 相关信息
     */
    public final static String APP_ID = "app_OiXzDS9evH0KifPa";
    public final static String Live_Secret_Key = "sk_live_zTabHG0aH8m9zbXvzT9CSqLS";
    public final static String Live_Publishable_Key = "pk_live_rzbjTO9mvPKSD4CGCOznH400";
    public final static String PUBLIC_KEY = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAsBcecxlnqhnIlOHLTu3o" +
            "cGr8XGa1PaRJFlwYr7YpXp4MiJc0rxnHiS+CF1xygjr0oXINAIvbT8b+PWxMSZf/" +
            "UrNvPOAS0f5j5VhmkUFUqqIoDXbZsiiQxQSgaAlWMidsgRXVG5AUD4PRn8gaNITk" +
            "sbLAYVad6tAhYvUcJt02KYJsCdA0LFy4l074okFBLwBEDCwgRywDezmVJTRTPefh" +
            "W/1ILYJq2TOG55ubQo6ucdSSYI1vAvKIlpWLaoQjzYj6tYjCc6r6/oCo5c4ucmQF" +
            "+Vb3Zg7dlSA0BUpHf5FMo931x9ZbGiDJhCTNbSEDPqbIStzbORlqaI2uDpqYc/gi" +
            "pwIDAQAB";
    /**
     * 阿里云Oss
     */
    public final static String accessKeyId = "dzhm6kIZDL8VpgPP";
    public final static String accessKeySecret = "4qSofG2TiEABy1Gcs0IhgHXpdLKust";
    public final static String MALL_bucketName = "waijiaojun";
    public final static String DOMAIN = "http://file.waijiaojun.com/";// file.globalvillage.biz
    /**
     * 文件父路径
     */
    public static final String FILE = "waijiaojun";
    /**
     * 图片路径
     */
    public static final String FILEIMG = "app";

    /**
     * 老师相关常量
     */
    public static class Teacher {
        public static class State {
            public static final String online = "0";
            public static final String busy = "2";
            public static final String offline = "1";
        }

        public static class StateOrder {
            public static final int online = 0;
            public static final int busy = 1;
            public static final int offline = 2;
        }

        public static class LiveChargedState {
            public static final int uncharged = 0;
            public static final int charged = 1;
        }
    }


    /**
     * 支付规则
     */
    public static String rule = "- Your payment is $0.2 dollars per minute, that is approximately $12 dollars per hour, for free topic chat.\n\n" +
            "- You will be paid on the 10th of every month for the last month's payment which based on the minutes you taught.\n\n" +
            "- Your earnings will be paid to your Paypal account, be sure to enter the correct email.\n\n" +
            "- The pay is calculated by the minute based on an hourly rate of $12 to $14, but only fully completed minutes are counted. Partial minutes are not counted.\n\n" +
            "- Please feel free to contact our team at nativetalk@waijiaojun.com if you have any questions.";

    /**
     * 老师资金流向类型（以用户在系统中的钱包为基准）：
     * 1流入（进入余额：+）；2流出（余额支出：-）
     */
    public static class fundFlowType {

        public static String in = "1";

        public static String out = "2";

    }


    /**
     *
     * 老师资金变化类型
     * 0:Freetalk 1:Appointment 2:Withdraw deposit 3:Others 4:live
     */
    public static class fundChangeTypeForTeacher {
        public static int freetalk_code = 0;
        public static String freetalk_msg = "Free talk class";

        public static int appointment_code = 1;
        public static String appointment_msg = "Appointment class";

        public static int drawDeposit_code = 2;
        public static String drawDeposit_msg = "Current deposit";

        public static int other_code = 3;
        public static String other_msg = "Other";

        public static int live_code = 4;
        public static String live_msg = "Live";

        public static int weike_code = 5;
        public static String weike_msg = "Audio Class";

    }


    /**
     * 学生支付类型
     */
    public static class ChargeType {
        /**
         * 充值
         */
        public static final int recharge_code = 0;
        public static final String recharge_msg = "充值";

        /**
         * 购买课程
         */
        public static final int buy_course_code = 1;
        public static final String buy_course_msg = "购买课程";

        /**
         * 取消预约
         */
        public static final int cancel_reserver_code = 2;
        public static final String cancel_reserver_msg = "取消预约";

        /**
         * 呼叫老师(闲聊)
         */
        public static final int call_teacher_free_talk_code = 3;
        public static final String call_teacher_free_talk_msg = "呼叫老师(闲聊)";

        /**
         * 其它(优惠码、周排行奖励、系统调整)
         */
        public static final int other_code = 4;
        public static final String other_msg = "其它(优惠码、周排行奖励、系统调整)";

        /**
         * 购买公开课
         */
        public static final int buy_live_course_code = 5;
        public static final String buy_live_course_msg = "购买公开课";

        /**
         * 充值付款失败，系统扣除
         */
        public static final int recharge_failure_code = 6;
        public static final String recharge_failure_msg = "充值付款失败，系统扣除";

        /**
         * 直播打赏
         */
        public static final int live_award_code = 7;
        public static final String live_award_msg = "直播打赏";

        /**
         * 直播打赏
         */
        public static final int buy_weike_code = 8;
        public static final String buy_weike_msg = "购买微课";
    }

    /**
     * 支付状态 1转账中 2已付款 3 付款失败
     */
    public static class PayState {
        /**
         * 转账中
         */
        public static final String transfering = "1";
        public static final String transfering_msg = "转账中";

        /**
         * 已付款
         */
        public static final String success = "2";
        public static final String success_msg = "已付款";

        /**
         * 付款失败
         */
        public static final String failure = "3";
        public static final String failure_msg = "付款失败";

    }

    /**
     * 学生购买课程套餐，套餐总的支付状态 1 待付款 2待结束 3支付完成
     */
    public static class SetMealPayState {
        /**
         * 1 待付款
         */
        public static final int unpaid = 1;
        public static final String unpaid_msg = "待付款";

        /**
         * 待结束
         */
        public static final int un_end = 2;
        public static final String un_end_msg = "待结束";

        /**
         * 支付完成
         */
        public static final int paid = 3;
        public static final String paid_msg = "支付完成";

    }

    /**
     * 用户余额变化类型：1 充值（进入余额：+）；2 消费（余额支出：-）
     */
    public static class FundChangeType {
        /**
         * 1 充值（进入余额：+）
         */
        public static final String wallet_in = "1";

        /**
         * 2 消费（余额支出：-）
         */
        public static final String wallet_out = "2";
    }

    /**
     * 支付渠道：0 余额支付；1 阿里支付；2 微信支付
     */
    public static class PaymentChannel {
        /**
         * 余额支付
         */
        public static final int wallet = 0;

        /**
         * 阿里支付
         */
        public static final int alipay = 1;

        /**
         * 微信支付
         */
        public static final int wxpay = 2;
    }

    /**
     * 预约状态
     */
    public static class ReserveState {
        //待上课
        public static final int ready_to_begin = 1;
        //已完成
        public static final int finished = 2;
        //已取消
        public static final int canceled = 3;
    }

    /**
     * 预约类型
     */
    public static class ReserveType {
        //试听预约
        public static final int listen_course = 1;
        //购买课程预约
        public static final int setmeal_course = 2;
    }

    /**
     * 预约时间表状态
     */
    public static class ReserveTimeState {
        //可用(open)
        public static final int open = 0;
        //不可用(closed)
        public static final int closed = 1;
        //被预约(booked)
        public static final int booked = 2;
    }

    /**
     * 优惠券状态
     */
    public static class CouponState {
        //未使用
        public static final int unused = 1;

        //已使用
        public static final int used = 2;

        //已过期
        public static final int out_of_time = 3;
    }

    /**
     * 优惠券类型
     */
    public static class CouponType {
        //直播
        public static final int live = 1;
    }

    /**
     * 短信接口使用的相关参数
     */
    public static class SMS253 {
        public static final String account = "N2551506";
        public static final String password = "UjGnvkEm0Jfaae";

        /**
         * 国内短信 api地址
         */
        public static final String url = "http://sms.253.com/msg/send";


        public static final String inter_account = "I3223831";
        public static final String inter_password = "jWdEByf6Vh2ec2";
        /**
         * 国际短信 api地址
         */
        public static final String inter_url = "http://intapi.253.com/send/json";

    }

    /**
     * 第三方类型
     */
    public static class ThirdPartyType {
        //手机登录
        public static final int mobile_Type = 0;
        //微信登录
        public static final int wx_Type = 1;
        //QQ登录
        public static final int qq_Type = 2;
        //新浪微博登录
        public static final int sinaWeiBo_Type = 3;
    }

    /**
     * 用户与第三方账号的绑定状态
     */
    public static class MemberBindStatus {
        //账号为绑定
        public static final int unBinded = 0;
        //账号已绑定
        public static final int Binded = 1;
    }

    /**
     * 用户账号的锁定状态
     */
    public static class MemberLockStatus {
        //账号为绑定
        public static final String locked = "0";
        //账号已绑定
        public static final String unlocked = "1";
    }

    /**
     * 用户性别类型
     */
    public static class MemberGender {
        //性别为男
        public static final String male = "1";
        //性别为女
        public static final String female = "2";
    }

    public static class FindLiveType {
        //所有直播课
        public static final int all = 2;
        //直播类别里的所有直播课
        public static final int category = 3;
        //热门直播课
        public static final int hot = 4;
        //已购直播课
        public static final int purchased = 5;
    }


    //log 记录方法入惨的前缀
    public static final String prefix_in = "\n    parameters in -->> ";
    //log 记录方法出惨的前缀
    public static final String prefix_out = "\n    parameters out -->>";

    public static class RoomState {
        // 教室关闭
        public static final int close = 1;

        // 教室打开
        public static final int open = 2;

        //上课已经结束，教室关闭
        public static final int end = 3;
    }

    public static class ClassRoom {
        public static class RoomStatus {
            public static final int UN_START = 1;// 未开始
            public static final int OPEN = 2;// 开放
            public static final int END = 3;// 上完课后教室关闭
        }

        public static class InRoom {
            public static final int yes = 1;
            public static final int no = 0;
        }

        public static class EventType {
            public static final String enter = "enter";// 进入教室
            public static final String leave = "leave";// 离开教室
        }
    }

    public static class SystemMessage{

        public static class  SysMsgType {
            /**
             * 学生
             */
            public static final int STUDENT=1;

            /**
             * 老师
             */
            public static final int TEACHER=2;

        }
    }

    public static class AppointmentType {
        public static final Integer add = 2; // 预约
        public static final Integer cancel = 1; // 取消预约
    }

    public static String TeenNotifyUrl;
    @Value("${teen.appointment.notify.url}")
    public void setTestUserModel(String value) {
        logger.info("teen.appointment.notify.url=" + value);
        TeenNotifyUrl = value;
    }

    public static class AppType{
        public static final String A = "A";
        public static final String T = "T";
    }

    public static final String KEY = "nativetalk";
}
